﻿namespace UnityEditor.Controls.MenuControl.ViewModel
{
    using System.Reflection;
    using System.Windows;

    public class MenuItemEventHandle
    {
        private MethodInfo methodInfo;

        public MenuItemEventHandle(MethodInfo methodInfo)
        {
            this.methodInfo = methodInfo;
        }

        public void RoutedEventHandlerMethod(object sender, RoutedEventArgs e)
        {
            if (methodInfo != null && methodInfo.IsStatic)
                methodInfo.Invoke(null, null);
        }
    }
}
